<?php
$products = $cms->products(3);
if (!empty($products)) {
    ?>
    <div class="container">
        <div class="ct_title">
            <h3 class="animate__animated animate__backInUp" data-wow-delay=".1s"
                style="visibility: visible; animation-delay: 0.1s; animation-name: fadeInUp;">推荐产品
                <span>PRODUCT RECOMMEND</span></h3>
            <p></p>
        </div>
        <div class="clf product_div">
            <ul>
                <?php foreach ($products as $key => $val) { ?>
                    <li class="animate__animated animate__backInUp" data-wow-delay="0.<?php echo $key ?>s"
                        style="visibility: visible; animation-delay: 0.<?php echo $key ?>s; animation-name: fadeInUp;">
                        <a href="/<?php echo $basepath . "/" . ($cms->is_html ? "product/product" . $val["idProduct"] . ".html" : "view/product_detail.php?&detail_id=" . $val["idProduct"] . "&type=product&id=" . $val["idDataCategory"]) ?>">
                            <div class="img">
                                <img src="/<?php echo $basepath ?>/assert/images/hangye.jpg"></div>
                            <div class="text">
                                <div class="box">
                                    <h3><?php echo $val["productName"] ?></h3>
                                    <p><?php echo substr($val["productDesc"], 0, 200) ?></p>
                                    <span class="btn">详情</span></div>
                            </div>
                        </a>
                    </li>
                <?php } ?>
            </ul>
        </div>
    </div>
<?php } ?>